<?php
// +----------------------------------------------------------------------
// | ThinkAdmin
// +----------------------------------------------------------------------
// | 版权所有 2018~2018 GoMaoMao [ http://www.gomaomao.com ]
// +----------------------------------------------------------------------
// | 官方网站: http://think.gomaomao.com
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | 联系方式：GoMaoMao <vip.vvm@qq.com>
// +----------------------------------------------------------------------
// | github开源项目：https://gitee.com/gomaomao.com/ThinkAdmin
// +----------------------------------------------------------------------

namespace app\miniprogram\controller\api;

use controller\BasicApi;

class Cate extends BasicApi
{
	public $table = 'cate';
	/**
	 * 前置列表
	 */
	function _index_before(&$param)
	{
		$param['fields']  = 'id,pid,cate_title,ico';
		$param['where'][] = ['is_deleted', '=', 0];
		$param['where'][] = ['status', '=', 1];
		$param['where'][] = ['website', '=', $param['website']];
		$param['order'] = 'sort asc,id asc';
		if (!empty($param['pid'])) {
			$_pid = $param['pid'];
		} else {
			$_pid = 0;
		}
		$param['where'][] = ['pid', '=', $_pid];
		return;
	}

}